package com.cam.generator.dict;

import com.cam.framework.annotation.SysDictAnno;
import com.cam.framework.crud.SysDictInterface;

@SysDictAnno(type = "gen_code_field_type")
public enum GenCodeFieldTypeDict implements SysDictInterface {

    /* 字符串类型 */
    TEXT("文本", "01", GenCodeDbFieldTypeDict.VARCHAR.getValue(), "String"),
    TEXTAREA("文本域", "02", GenCodeDbFieldTypeDict.TEXT.getValue(), "String"),
    RICH_TEXT("富文本", "03", GenCodeDbFieldTypeDict.LONG_TEXT.getValue(), "String"),

    /* 数字类型 */
    INT("整数", "11", GenCodeDbFieldTypeDict.INT.getValue(), "Integer"),
    DECIMAL("金额", "12", GenCodeDbFieldTypeDict.DECIMAL.getValue(), "BigDecimal"),

    /* 日期类型 */
    DATE("日期", "21", GenCodeDbFieldTypeDict.DATE.getValue(), "Date"),
    DATETIME("时间", "22", GenCodeDbFieldTypeDict.DATETIME.getValue(), "Date"),

    /* 其他类型 */
    OBJECT("对象类型", "91", GenCodeDbFieldTypeDict.FOREIGN_KEY.getValue(), "String"),
    DICT("字典类型", "92", GenCodeDbFieldTypeDict.VARCHAR.getValue(), "String"),

    ;


    private final String label;

    private final String value;

    private final String dbType;

    private final String javaType;

    GenCodeFieldTypeDict(String label, String value, String dbType, String javaType) {
        this.label = label;
        this.value = value;
        this.dbType = dbType;
        this.javaType = javaType;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getValue() {
        return value;
    }

    public String getDbType() {
        return dbType;
    }

    public String getJavaType() {
        return javaType;
    }

}
